$(function(){
    console.log($('.content'))
    $('.icon_small').eq(7).click(function(e){
        e.preventDefault()
    })
    $('.icon_small').eq(7).click(function(e){
        $(this).nextAll().slideToggle()
    })
    fetch('http://chst.vip:1234/api/getmoneyctrl')
    .then(body=>body.json())
    .then(res=>{
        console.log(res.result)
        let oul = document.querySelector('.list')
        var txt = ''
        res.result.forEach((item) => {
            console.log(item.productImgSm)
            let regExp = /(?<=imgurl=)[^'"]*/
            let r = item.productImgSm.match(regExp)
            txt += `<li productId='${item.productId}'>
                        <img src=${r[0]} alt="">
                        <div class="text">
                            <span>${item.productName}</span>
                            <span>${item.productPinkage}</span>
                            <span>${item.productFrom}</span>
                            <span>${item.productTime}</span>
                            <span>${item.productComCount}</span>
                        </div>
                    </li>`
        })
        oul.innerHTML = txt
        $('.list li').click(function(){
            var productId = $(this).attr('productId')
            location.href = `./pages/index_xq.html?productid=${productId}`
        })
    })

})